package alarmlistener;

import java.util.ArrayList;
import settings.MainSettingsManager;
import settings.collections.elements.Schleife;

class SchleifenManager{
    private ArrayList<Schleife> schleifen;
    private String[] ID = new String[7];
    

    public SchleifenManager()
    {
        schleifen = MainSettingsManager.getSetting().getSchleifenCollection().getSchleifen();
    }

    
    public String getReadableString(int id) {
        return schleifen.get(id).getName();
    }

    public boolean isRelevant(String ric) {
        for (Schleife schleife: schleifen)
            if (schleife.getRic().equals(ric))
                return true;

        return false;
    }

    public String getBinaryString(ArrayList<String> rics)
    {
        
        String ret = "";
        for(Schleife schleife: schleifen)
            if(rics.contains(schleife.getRic()))
                ret += "1";
            else
                ret += "0";

        return ret;
    }

    public String getExpressRIC()
    {
        for (Schleife schleife: schleifen)
            if(schleife.getName().contains("EXPRESS"))
                return schleife.getRic();
        
        return null;
    }



}

